package com.aaa.watch;

import java.util.ArrayList;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年11月09日15:51
 */
public class APublic implements Bpublic{
    private String msg;
    private ArrayList<UserInterface> list=new ArrayList<UserInterface>();

    public void guanzhu(UserInterface userInterface) {
        list.add(userInterface);
    }

    public void quxiao(UserInterface userInterface) {
        list.remove(userInterface);
    }

    public void setMsg(String msg) {
        this.msg=msg;
    }

    public void qunFa() {
        //耗时
        for (UserInterface userInterface:list){
            userInterface.getMsg(msg);
        }
    }
}
